package com.ruoyi.crm.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.crm.mapper.PayPlanMapper;
import com.ruoyi.crm.domain.PayPlan;
import com.ruoyi.crm.service.IPayPlanService;

/**
 * 付款计划Service业务层处理
 *
 * @author ruoyi
 * @date 2021-09-01
 */
@Service
public class PayPlanServiceImpl implements IPayPlanService
{
    @Autowired
    private PayPlanMapper payPlanMapper;

    /**
     * 查询付款计划
     *
     * @param id 付款计划主键
     * @return 付款计划
     */
    @Override
    public PayPlan selectPayPlanById(String id)
    {
        return payPlanMapper.selectPayPlanById(id);
    }

    /**
     * 查询付款计划列表
     *
     * @param payPlan 付款计划
     * @return 付款计划
     */
    @Override
    public List<PayPlan> selectPayPlanList(PayPlan payPlan)
    {
        return payPlanMapper.selectPayPlanList(payPlan);
    }

    /**
     * 新增付款计划
     *
     * @param payPlan 付款计划
     * @return 结果
     */
    @Override
    public int insertPayPlan(PayPlan payPlan)
    {
        return payPlanMapper.insertPayPlan(payPlan);
    }

    /**
     * 修改付款计划
     *
     * @param payPlan 付款计划
     * @return 结果
     */
    @Override
    public int updatePayPlan(PayPlan payPlan)
    {
        payPlan.setUpdateTime(DateUtils.getNowDate());
        return payPlanMapper.updatePayPlan(payPlan);
    }

    /**
     * 批量删除付款计划
     *
     * @param ids 需要删除的付款计划主键
     * @return 结果
     */
    @Override
    public int deletePayPlanByIds(String[] ids)
    {
        return payPlanMapper.deletePayPlanByIds(ids);
    }

    /**
     * 删除付款计划信息
     *
     * @param id 付款计划主键
     * @return 结果
     */
    @Override
    public int deletePayPlanById(String id)
    {
        return payPlanMapper.deletePayPlanById(id);
    }
}